

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="参考资料 视频资料 一、原理分析 SSH ，全称SecureShell  ，中文称为安全外壳协议。百度百科 SSH免密登陆原理图： ssh免密登陆最常用的一种加密算法是：rsa算法：[百度百科]，本篇文章是基于该算法进行免密登陆的。 首先通过原理图可以总结出以下几个要点：（以服务器A SSH免密登陆 服务器B 为例）  A 生成密钥对，即公钥A和私钥A A将自己的公钥A发送给B 此时B将公钥A保存">
<meta property="og:type" content="article">
<meta property="og:title" content="Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥">
<meta property="og:url" content="http://example.com/2022/01/15/Hadoop%20_%20%E9%9B%86%E7%BE%A4%E9%85%8D%E7%BD%AE%EF%BC%88%E4%BA%8C%EF%BC%89SSH%E5%85%8D%E5%AF%86%E7%99%BB%E9%99%86%E5%8E%9F%E7%90%86%E4%BB%A5%E5%8F%8A%E6%93%8D%E4%BD%9C%20_%20%E5%85%AC%E9%92%A5%E4%B8%8E%E7%A7%81%E9%92%A5/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="参考资料 视频资料 一、原理分析 SSH ，全称SecureShell  ，中文称为安全外壳协议。百度百科 SSH免密登陆原理图： ssh免密登陆最常用的一种加密算法是：rsa算法：[百度百科]，本篇文章是基于该算法进行免密登陆的。 首先通过原理图可以总结出以下几个要点：（以服务器A SSH免密登陆 服务器B 为例）  A 生成密钥对，即公钥A和私钥A A将自己的公钥A发送给B 此时B将公钥A保存">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/4b4b7646f3d44010a4a505c3506bd175.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/a9180d61a9d64cfba08a2f9e625c7cef.png">
<meta property="article:published_time" content="2022-01-15T13:57:26.000Z">
<meta property="article:modified_time" content="2022-08-22T15:43:46.764Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="Hadoop">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/4b4b7646f3d44010a4a505c3506bd175.png#pic_center">
  
  
  
  <title>Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>尤 Ni&#39;s Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        John Doe
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-01-15 21:57" pubdate>
          2022年1月15日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          1.2k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          11 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：1 小时前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><hr>
<p><a target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1Qp4y1n7EN?p=29">视频资料</a></p>
<h1 id="一、原理分析"><a href="#一、原理分析" class="headerlink" title="一、原理分析"></a>一、原理分析</h1><hr>
<p>SSH ，全称SecureShell  ，中文称为安全外壳协议。<a target="_blank" rel="noopener" href="https://baike.baidu.com/item/ssh/10407?fr=aladdin">百度百科</a></p>
<p><em><strong>SSH免密登陆原理图：</strong></em><br><img src="https://img-blog.csdnimg.cn/4b4b7646f3d44010a4a505c3506bd175.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>ssh免密登陆最常用的一种加密算法是：rsa算法：<a target="_blank" rel="noopener" href="https://baike.baidu.com/item/RSA%E7%AE%97%E6%B3%95/263310?fr=aladdin">[百度百科]</a>，本篇文章是基于该算法进行免密登陆的。</p>
<p>首先通过原理图可以总结出以下几个要点：（以服务器A SSH免密登陆 服务器B 为例）</p>
<ul>
<li>A 生成密钥对，即公钥A和私钥A</li>
<li>A将自己的公钥A发送给B</li>
<li>此时B将公钥A保存在<code>~/.ssh</code>下的 <code>authorized_keys</code> 文件中</li>
<li>当A向B发送ssh远程连接时，A将通过私钥A加密后的数据发送给B</li>
<li>B接收到数据，首先去<code>authorized_keys</code>里查找公钥A，若存在则根据公钥A对数据解密，同时在把数据发给A</li>
<li>A接收到B使用公钥A解密（相对A来说是加密）后的数据，再次使用自身的私钥进行解密，如果和之前发送的数据匹配则建立TCP连接。</li>
</ul>
<h1 id="二、配置步骤"><a href="#二、配置步骤" class="headerlink" title="二、配置步骤"></a>二、配置步骤</h1><hr>
<p>实现服务器A可以SSH免密登陆服务器B</p>
<h2 id="2-1-生成密钥对"><a href="#2-1-生成密钥对" class="headerlink" title="2.1 生成密钥对"></a>2.1 生成密钥对</h2><p>在服务器A生成密钥对</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">ssh-keygen -t rsa<br></code></pre></td></tr></table></figure>
<p>这里的<code>rsa</code>是一种密钥对的加密算法</p>
<p>输入命令后需要配置一些信息，直接回车，表示默认即可<br><img src="https://img-blog.csdnimg.cn/a9180d61a9d64cfba08a2f9e625c7cef.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>输入完毕后，会在~&#x2F; 用户文件夹下生成一个<code>.ssh文件夹</code></p>
<p>里面存放的文件以及说明</p>
<table>
<thead>
<tr>
<th align="left">文件</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="left">id_rsa</td>
<td align="left">私钥</td>
</tr>
<tr>
<td align="left">id_rsa_pub</td>
<td align="left">公钥</td>
</tr>
<tr>
<td align="left">known_hosts</td>
<td align="left">通过SSH访问过本机的主机名以及相关的访问记录</td>
</tr>
</tbody></table>
<p>根据之前的原理图，我们需要将公钥发送到其他服务器，这样就可以远程连接那个服务器。</p>
<h2 id="拷贝公钥"><a href="#拷贝公钥" class="headerlink" title="拷贝公钥"></a>拷贝公钥</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">ssh-copy-id b<br></code></pre></td></tr></table></figure>
<p>将本机（a）的公钥发送给服务器b，此时会提示输入服务器b的密码。</p>
<p>拷贝成功后，服务器b的<code>~/.ssh</code>目录下会生成一个 <code>authorized_keys</code>文件，里面的内容表示允许哪些主机远程登陆本机，即和哪些主机达成了ssh免密登陆的协议。</p>
<h2 id="2-2-测试ssh命令"><a href="#2-2-测试ssh命令" class="headerlink" title="2.2 测试ssh命令"></a>2.2 测试ssh命令</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">ssh b<br></code></pre></td></tr></table></figure>
<p>直接以<code>shh 主机名</code>的形式就能远程登陆了，若要退出可输入<code>exit</code>命令</p>
<h2 id="2-3-注意点："><a href="#2-3-注意点：" class="headerlink" title="2.3 注意点："></a>2.3 注意点：</h2><ul>
<li>ssh 本机也需要通过<code>ssh-copy-id</code>命令发送公钥给自己，否则ssh本机是需要输入密码的。<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">ssh-copy-id localhost<br><br>ssh localhost <br></code></pre></td></tr></table></figure></li>
<li><code>.ssh</code>文件夹是存在用户文件夹中的，所以不同用户的ssh免密登陆的主机是完全不一样的。比如之前在root用户里配置了ssh免密登陆，只要切换到了其他的用户，免密登陆就不生效了，因为root用户的ssh文件信息是存在<code>/home/root/.ssh</code>中的，这源自Linux系统的多用户特点。</li>
</ul>
<h1 id="三、总结"><a href="#三、总结" class="headerlink" title="三、总结"></a>三、总结</h1><hr>
<p>在hadoop集群中配置ssh密码登陆就两个步骤：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">ssh-keygen -t rsa<br><br>ssh-copy-id 服务器名称<br></code></pre></td></tr></table></figure>

<p>主要过程还是得好好理解一下，比如：A免密SSH连接B<br>对于A</p>
<ul>
<li><code>id_rsa</code> 存储私钥的内容</li>
<li><code>id_rsa_pub</code>存储公钥的内容</li>
</ul>
<p>对于B</p>
<ul>
<li><code>authorized_keys</code> 存储了A的公钥</li>
<li><code>known_hosts</code>存储SSH免密访问过的信息</li>
</ul>
<p>它们都存储在 用户目录 <code>~/.ssh</code>中。</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE/" class="category-chain-item">大数据</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/Hadoop/">#Hadoop</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥</div>
      <div>http://example.com/2022/01/15/Hadoop _ 集群配置（二）SSH免密登陆原理以及操作 _ 公钥与私钥/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>John Doe</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年1月15日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/01/16/MyBatis%20%E7%AC%94%E8%AE%B03%20%E5%8A%A8%E6%80%81SQL%E8%AF%AD%E5%8F%A5%20_%20trim%E6%A0%87%E7%AD%BE%E3%80%81foreach%E6%A0%87%E7%AD%BE%E3%80%81choose%E6%A0%87%E7%AD%BE%20_%20MyBatis%E7%BC%93%E5%AD%98%E6%9C%BA%E5%88%B6%20_%20MyBatis%20%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B%E4%BD%BF%E7%94%A8%E6%A1%88%E4%BE%8B/" title="MyBatis 笔记3 动态SQL语句 _ trim标签、foreach标签、choose标签 _ MyBatis缓存机制 _ MyBatis 逆向工程使用案例">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">MyBatis 笔记3 动态SQL语句 _ trim标签、foreach标签、choose标签 _ MyBatis缓存机制 _ MyBatis 逆向工程使用案例</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/01/15/Hadoop%20_%20%E9%9B%86%E7%BE%A4%E9%85%8D%E7%BD%AE%EF%BC%88%E4%B8%80%EF%BC%89%E4%BD%BF%E7%94%A8Shell%E8%84%9A%E6%9C%AC%E8%A7%A3%E5%86%B3%E5%AE%8C%E5%85%A8%E5%88%86%E5%B8%83%E5%BC%8F%E9%9B%86%E7%BE%A4%E8%8A%82%E7%82%B9%E4%B9%8B%E9%97%B4%E7%9A%84%E6%96%87%E4%BB%B6%E4%BC%A0%E8%BE%93%E9%97%AE%E9%A2%98%20_%20scp%E5%91%BD%E4%BB%A4%20_%20rsync%E5%91%BD%E4%BB%A4/" title="Hadoop _ 集群配置（一）使用Shell脚本解决完全分布式集群节点之间的文件传输问题 _ scp命令 _ rsync命令">
                        <span class="hidden-mobile">Hadoop _ 集群配置（一）使用Shell脚本解决完全分布式集群节点之间的文件传输问题 _ scp命令 _ rsync命令</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
